Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate a ./configure bashism #8813

Closed
wants to merge 1 commit into from
Closed

Conversation

rlaager
Copy link
Member

@rlaager rlaager commented May 24, 2019

Motivation and Context

configure fails when /bin/sh is not bash. See #8809.

Description

This replaces test "${PYTHON_VERSION:0:2}" = "2." with echo "${PYTHON_VERSION}" | grep -q "^2\\.".

How Has This Been Tested?

I tested the individual snippets of code in dash and bash. I can reproduce the problem that way. I haven't yet figured out how to reproduce the failure with ./configure from #8809. I probably need to be passing different arguments or something.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

configure uses /bin/sh, which is not necessarily bash.

Fixes openzfs#8809

Signed-off-by: Richard Laager <rlaager@wiktel.com>
@codecov
Copy link

codecov bot commented May 25, 2019

Codecov Report

Merging #8813 into master will increase coverage by 0.26%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8813      +/-   ##
==========================================
+ Coverage   78.65%   78.92%   +0.26%     
==========================================
  Files         382      382              
  Lines      117809   117809              
==========================================
+ Hits        92662    92978     +316     
+ Misses      25147    24831     -316
Flag Coverage Δ
#kernel 64.51% <ø> (-14.74%) ⬇️
#user 67.79% <ø> (+0.4%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4397794...c41492e. Read the comment docs.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label May 25, 2019
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@behlendorf behlendorf requested a review from jwk404 May 25, 2019 21:18
@rlaager
Copy link
Member Author

rlaager commented May 27, 2019

When I created this, I didn't see that #8731 already existed. That solution looks more comprehensive.

@Vaelatern
Copy link
Contributor

Would like to point out that test "${PYTHON_VERSION##2.*}" = "" allows you to keep the same test mechanism as previous, and definitely works.

@behlendorf
Copy link
Contributor

behlendorf commented May 28, 2019

I'd forgotten #8731 as well. I do agree that if we can verify that expr "${PYTHON_VERSION}" : 3\\. >/dev/null check works for for dash, and sort out a few other minor nits, then that's the way to go.

@Vaelatern
Copy link
Contributor

Verified on dash 0.5.10.2.

@rlaager
Copy link
Member Author

rlaager commented May 29, 2019

Agreed that expr "${PYTHON_VERSION}" : 3\\. >/dev/null works on dash. Closing in favor of #8731.

@rlaager rlaager closed this May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Code Review Needed Ready for review and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants